<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>

<html>
<head>
    <title>HelloWorld for order JSP</title>
    <style>
        .seckill_mod_goods {
            float: left;
            margin-left: 10px;
            margin-bottom: 10px;
            height: 400px;
            position: relative;
            background: cornsilk;
            list-style: none;
        }

        .seckill_mod_goods_link_img {
            width: auto;
            height: 200px;
            vertical-align: middle;
        }

        .seckill_mod_goods_link {
            width: 230px;
            padding: 20px 30px 0;
            display: block;
            /*text-decoration: none;*/
            overflow: hidden;
            text-align: center;

        }

        .seckill_mod_goods_info_i {
            color: currentColor;
            height: 40px;
            line-height: 40px;
            font-size: 16px;
            display: block;
            margin: auto 100px 0;
            width: 80px;
            text-align: center;
            position: absolute;
            background: chocolate;
        }
    </style>
</head>
<body>

<%--<c:forEach items="${orders}" var="order">--%>
<%--    <p>${order.total}</p>--%>
<%--</c:forEach>--%>
<ul>
    <c:forEach items="${goods}" var="good">

        <li class="seckill_mod_goods " data-skid="10029958247004" data-manual="40_1_10029958247004_1_1##24694_0_0_0">
            <a target="_blank" class="seckill_mod_goods_link">
                <img class="seckill_mod_goods_link_img"
                     src="${good.img}">
                <h4 class="seckill_mod_goods_title ">${good.name}</h4>
            </a>
            <div class="seckill_mod_goods_info">
                <p>剩余数量: ${good.stock}</p>
                <c:choose>
                    <c:when test="${good.stock >0}">
                        <a href="/order/secondsKill?orderId=${good.id}" target="_blank"
                           class="seckill_mod_goods_info_i">
                            立即抢购
                        </a>
                    </c:when>
                    <c:otherwise>
                        <p class="seckill_mod_goods_info_i" style="background: darkgrey">
                            立即抢购
                        </p>
                    </c:otherwise>
                </c:choose>>

            </div>
        </li>
    </c:forEach>
</ul>
</body>
</html>